import json

"""文件操作相关工具"""
class FileTools:

    # 读取JSON文件返回字典
    @staticmethod
    def read_json(file_path: str):
        with open(file_path, 'r', encoding='utf-8') as f:
            return json.load(f)

    # 对象转json字符串
    @staticmethod
    def obj_to_json(obj):
        return json.dumps(obj, ensure_ascii=False)